﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="ReclamacoesAdm.aspx.cs" Inherits="Administracao_ReclamacoesAdm" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentCenter" runat="Server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <h2>
        Reclamações Cadastradas
    </h2>
    <div class="opcoes_pesquisa">
        <div>
            <table>
                <tr>
                    <td>
                        <asp:TextBox ID="txtPesquisa" runat="server" Width="300px" MaxLength="100" />
                    </td>
                    <td>
                        <asp:Button ID="btnPesquisar" runat="server" Text="Pesquisar" SkinID="btnControleSkin"
                            OnClick="btnPesquisar_Click" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:RadioButtonList ID="rblMetodoPesquisa" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Value="descricao" Selected="True">Descrição</asp:ListItem>
                            <asp:ListItem Value="palavraChave">Palavra-Chave</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <asp:Panel ID="frmOpcoesPesquisa" runat="server">
                <table>
                    <tr>
                        <td>
                            Período De &nbsp;
                            <asp:TextBox ID="txtDataInicial" runat="server" /><asp:Image ID="imgDataInicial"
                                runat="server" ImageUrl="~/App_Themes/SomTheme/imagens/calendario.png" />
                        </td>
                        <td>
                            a &nbsp;
                            <asp:TextBox ID="txtDataFinal" runat="server" /><asp:Image ID="imgDataFinal" runat="server"
                                ImageUrl="~/App_Themes/SomTheme/imagens/calendario.png" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:CalendarExtender ID="cleDataInicial" runat="server" TargetControlID="txtDataInicial"
                Format="dd-MM-yyyy" PopupButtonID="imgDataInicial" />
            <asp:CalendarExtender ID="cleDataFinal" runat="server" TargetControlID="txtDataFinal"
                Format="dd-MM-yyyy" PopupButtonID="imgDataFinal" />
            <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDataInicial"
                Format="dd/MM/yyyy" PopupButtonID="imgDataInicial" />
            <asp:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtDataFinal"
                Format="dd/MM/yyyy" PopupButtonID="imgDataFinal" />
            <asp:MaskedEditExtender ID="mkeDataInicial" runat="server" TargetControlID="txtDataInicial"
                Mask="99/99/9999" MaskType="Date" InputDirection="LeftToRight" />
            <asp:MaskedEditValidator ID="mkvDataInicial" runat="server" IsValidEmpty="true" TooltipMessage="*"
                ControlToValidate="txtDataInicial" ControlExtender="mkeDataInicial" />
            <asp:MaskedEditExtender ID="mkeDataFinal" runat="server" TargetControlID="txtDataFinal"
                Mask="99/99/9999" MaskType="Date" InputDirection="LeftToRight" />
            <asp:MaskedEditValidator ID="mkvDataFinal" runat="server" IsValidEmpty="true" TooltipMessage="*"
                ControlToValidate="txtDataFinal" ControlExtender="mkeDataFinal" />
        </div>
    </div>
    <div>
        <asp:Panel ID="frmReclamacoesUsuario" runat="server" Width="100%">
            <asp:GridView ID="grvReclamacoes" runat="server" AutoGenerateColumns="False" DataKeyNames="rec_id_reclamacao"
                OnRowDataBound="grvReclamacoesUsuario_RowDataBound" GridLines="Both" CellPadding="-1"
                AlternatingRowStyle-CssClass="grid-reclamacoes-alt-item" HeaderStyle-CssClass="grid-reclamacoes-header"
                RowStyle-CssClass="grid-reclamacoes-item" CssClass="grid-reclamacoes">
                <RowStyle CssClass="grid-reclamacoes-item" />
                <Columns>
                    <asp:BoundField DataField="rec_id_reclamacao" HeaderText="Nº da Reclamação" />
                    <asp:BoundField DataField="rec_ds_reclamacao" HeaderText="Descrição" />
                    <asp:BoundField DataField="rec_dt_data" HeaderText="Data da Reclamação" />
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Instituição
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblInstituicao" runat="server" Text='<%#Eval("ins_instituicao.ins_nm_instituicao") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Usuário
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblUsuario" runat="server" Text='<%#Eval("usr_usuario.usr_ds_nickname") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Álbum
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:HyperLink ID="hplUrlImagem" runat="server" Text="Visualizar" ImageUrl="~/App_Themes/SomTheme/imagens/flickr.png"
                                NavigateUrl='<%#Eval("img_imagem.img_ds_url") %>' ToolTip='<%#Eval("img_imagem.img_ds_url") %>'
                                Target="_blank" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Vídeo
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:HyperLink ID="hplUrlVideo" runat="server" Text="Visualizar" ImageUrl="~/App_Themes/SomTheme/imagens/youtube.png"
                                NavigateUrl='<%#Eval("vdo_video.vdo_ds_url") %>' ToolTip='<%#Eval("vdo_video.vdo_ds_url") %>'
                                Target="_blank" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Localização
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:HyperLink ID="hplVerMapa" runat="server" Text="Ver no mapa" ImageUrl="~/App_Themes/SomTheme/imagens/map.png"
                                ToolTip='<%# Eval("loc_localizacao.loc_ds_latitude") + ";" + Eval("loc_localizacao.loc_ds_longitude") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Status
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:DropDownList ID="ddlStatusReclamacao" runat="server" ToolTip="Status da reclamação.">
                                <asp:ListItem Text="Pendente" Value="1"></asp:ListItem>
                                <asp:ListItem Text="Analisada" Value="2"></asp:ListItem>
                                <asp:ListItem Text="Resolvida" Value="3"></asp:ListItem>
                                <asp:ListItem Text="Reprovada" Value="4"></asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HyperLink ID="hypVisualizarReclamacao" runat="server" ImageUrl="~/App_Themes/SomTheme/imagens/lupa.png"
                                ToolTip="Visualizar" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HyperLink ID="hlkExcluirReclamacao" runat="server" Text="Excluir" ImageUrl="~/App_Themes/SomTheme/imagens/cross_icon.png"
                                ToolTip="Excluir Registro" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    Nenhuma reclamação encontrada com esses critérios de busca.</EmptyDataTemplate>
                <HeaderStyle CssClass="grid-reclamacoes-header" />
                <AlternatingRowStyle CssClass="grid-reclamacoes-alt-item" />
            </asp:GridView>
        </asp:Panel>
    </div>
    <br class="spacer" />
    <hr />
    <div id="divControles">
        <asp:Button ID="btnSalvar" runat="server" OnClick="btnSalvar_Click" Text="Salvar"
            SkinID="btnControleSkin" />
        &nbsp;<asp:Button ID="btnCancelar" runat="server" CausesValidation="false" OnClick="btnCancelar_Click"
            Text="Cancelar" SkinID="btnControleSkin" />
    </div>
</asp:Content>
